home *** CD-ROM | disk | FTP | other *** search
- Path: jhunix.hcf.jhu.edu!hbien
- From: hbien@jhunix.hcf.jhu.edu (Harold Bien)
- Newsgroups: comp.lang.c++
- Subject: Re: Efficiency Question
- Date: 4 Jan 1996 01:31:47 GMT
- Organization: HCF - Johns Hopkins University, Baltimore, Maryland, USA
- Message-ID: <4cfam3$r8h@news.jhu.edu>
- References: <4bsc04$bd1@micro.internexus.net>
- NNTP-Posting-Host: 128.220.2.5
- X-Newsreader: TIN [version 1.2 PL2]
-
- Laszlo Vecsey (master@micro.internexus.net) wrote:
- : Shown below are a few different ways of clearing a screen using an escape
- : sequence. It sends the escape character and [2J to stdout.
-
- : cout << char(27) << char('[') << char('2') << char('J');
- : cout << char(27) << "[2J";
- : cout << "\27[2J";
-
- : Now my question is, which one of these will most likely compile out to
- : the least instructions? For example, with the first method would there
-
- Are you looking for faster execution times or smaller code
- space? If you are interested purely in the "number of instructions"
- generated, try compiling to assembly source (if Borland, I think its
- -s). Then, compare each of the lines (Borland does a nice job of
- commenting each ASM section with the C(++) source). If you get an
- answer, please post. I'm curious but too lazy to try it myself.
-